// 使用库函数得到结构体成员变量相对结构体起始地址的偏移量

#include <stdio.h>
#include <stddef.h>
#include "studentInfo.h"

int main()
{
    printf("offsetof(struct StudentInfo, _name) : %d\n", offsetof(struct StudentInfo, _name));
    printf("offsetof(struct StudentInfo, _age) : %d\n", offsetof(struct StudentInfo, _age));
    printf("offsetof(struct StudentInfo, _id) : %d\n", offsetof(struct StudentInfo, _id));
    printf("offsetof(struct StudentInfo, _weight) : %d\n", offsetof(struct StudentInfo, _weight));
    printf("offsetof(struct StudentInfo, _height) : %d\n", offsetof(struct StudentInfo, _height));
    printf("offsetof(struct StudentInfo, _sex) : %d\n", offsetof(struct StudentInfo, _sex));
}
